// pages/computed/driver/driver.js
const http = require("../../../utils/http");
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        list:{
            type:Array
        }
    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
          // 切换洲
    tryDriver:function(e) {
        console.log("点击了！");
        // 获取点击的元素的下标
        var index = e.currentTarget.dataset.index;
        var name = e.currentTarget.dataset.name;
        console.log(index,name);
        this.setData({userCellId:index});
        this.setData({continent:name});
        this.getDataList();
    },

     // 获取数据
     getDataList(){
        // 获取洲数据
        http.request("requirement/destination/countries/"+this.data.continent, {}, "get").then(res => {
           console.log(res);
           console.log("requirement/destination/countries/"+this.data.continent);
           this.setData({country: res.data})
       });
   },
   attached:function(options){
    this.getDataList();
    }
    }
})


